package map;

import org.junit.Test;

import map.Map.Visitor;

public class MapTest {
	@Test
	public void testTreeMap() throws Exception {
		Map<String, Integer> map = new TreeMap<>();
		map.put("jack", 32);
		map.put("Michael", 11);
		map.put("Irving", 40);
		map.put("Lebron", 23);
		map.put("Lebron", 63);
		map.traversal(new Visitor<String, Integer>() {

			@Override
			public boolean visit(String key, Integer value) {
				System.out.println(key + "_" + value);
				return false;
			}
		});
		System.out.println();
		map.remove("Irving");
		map.traversal(new Visitor<String, Integer>() {
			
			@Override
			public boolean visit(String key, Integer value) {
				System.out.println(key + "_" + value);
				return false;
			}
		});
	}
}
